<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <canvas id="canvas"></canvas>
    <script src="initCanvas.js"></script>
    <script>
        $(function ($) {
            console.log(canvas)
            var img = new Image()
            img.src = 'a.jpg'

            // context.translate(100, 100)
            // context.rotate(45 * Math.PI / 180)

            img.onload = function () {
                context.drawImage(img,0,0)
                var imgdata = context.getImageData(0,0,img.width, img.height)
                var pixel = imgdata.data;

                var r = pixel[0];
                var g = pixel[1];
                var b = pixel[2];
                var a = pixel[3];
                console.log(pixel.length)
                console.log('red: ',r)
                console.log('green: ',g)
                console.log('blue: ',b)
                console.log('apliha: ',a)

            }
        })




    </script>

</body>

</html>